from alipay import AliPay

from .pem.alipay_public_key import ALIPAY_PUBLIC_KEY_STRING
from .pem.app_private_key import APP_PRIVATE_KEY_STRING
from . import settings

alipay = AliPay(
    appid=settings.APPID,
    app_notify_url='http://127.0.0.1:8000/home/',  # the default notify path
    app_private_key_string=APP_PRIVATE_KEY_STRING,
    # alipay public key, do not use your own public key!
    alipay_public_key_string=ALIPAY_PUBLIC_KEY_STRING,
    sign_type=settings.SIGN, # RSA or RSA2
    debug=settings.DEBUG  # False by default
)
gateway = settings.GATEWAY